package com.sky.mapper;

import com.sky.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author luo20
* @description 针对表【user(用户信息)】的数据库操作Mapper
* @createDate 2025-07-18 01:56:57
* @Entity com.sky.entity.User
*/
public interface UserMapper extends BaseMapper<User> {
    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 插入用户
     * @param user
     * @return
     */
    Integer insertUser(User user);
    /**
     * 根据条件获取每日用户数
     * @param map
     * @return
     */
    @MapKey("totalUser")
    List<Map<String, Object>> countUserStatistics(Map<String, Object> map);
}




